package com.caigou.modules.gallery.adpter

import com.caigou.comm.base.utils.ImageLoader
import com.caigou.modules.gallery.R
import com.caigou.modules.gallery.bean.GalleryItemBean
import com.chad.library.adapter.base.BaseSectionQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @author #Suyghur.
 * Created on 2021/12/31
 */
class GalleryItemAdapter(dataset: MutableList<GalleryItemBean>) :
    BaseSectionQuickAdapter<GalleryItemBean, BaseViewHolder>(R.layout.item_gallery_section, R.layout.item_index_list, dataset) {
    override fun convert(holder: BaseViewHolder, item: GalleryItemBean) {
        holder.setText(R.id.item_index_tv_title, item.depotName)
        ImageLoader.load(context, item.cover, holder.getView(R.id.item_index_iv_cover))
    }

    override fun convertHeader(helper: BaseViewHolder, item: GalleryItemBean) {
        helper.setText(R.id.item_gallery_section_tv_desc, item.pinyinIndex)
    }
}